package com.dragon.modules.yuegou.service.pay;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.modules.yuegou.entity.pay.PaymentRecordEntity;
import com.dragon.modules.yuegou.model.pay.PaymentRecord;
import com.dragon.modules.yuegou.model.pay.UnifyPayModel;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 支付记录表 服务接口
 *
 * @author pbuilder generated
 * @date 2019-03-19 08:59:41
 * @version 2.0
 */
public interface PaymentRecordService extends IService<PaymentRecordEntity> {


    /**
     * 必传字段
     * appId 应用id
     * orderNo 订单号
     * memberId 会员id
     * PayType 支付类型
     *
     * 悦卡支付 需要传
     * merchantId 商户id
     * yueCards 悦卡明细
     * price 原价
     * practicalPay 实际价格
     *
     * 微信支付 需要传
     * openId
     *
     * 统一支付模块
     * @param unifyPayModel
     * @return
     */
    Map<String,Object> unifyPay(UnifyPayModel unifyPayModel);

    /**
     * 退款
     * @param orderNo
     * @param refundAmount
     * @param refundReason
     */
    void refund(String orderNo, String refundAmount,String refundReason);
    /**
     * 退悦卡
     * @param orderNo
     * @param refundAmount
     * @param refundReason
     */
    String refund(String refundId,String orderNo, String refundAmount,String refundReason);

    /**
     * 退款
     * @param goodsId
     * @param refundAmount
     * @param refundReason
     */
    void refundByGoodsId(String goodsId, String refundAmount,String refundReason);
    
    /**
     * 2.3.17~2.3.18 退款
     * @param goodsId
     * @param refundAmount
     * @param refundReason
     */
    void redBeanRefundByGoodsId(String goodsId, String refundAmount,String refundReason,String merchantId);

    /**
     * 提现到银行卡
     * @param merchantUserId
     * @param fee
     * @param poundage
     */
    void payBank(String merchantUserId, BigDecimal fee,BigDecimal poundage);

    /**
     *  提现到微信
     * @param merchantUserId
     * @param merchantId
     * @param fee
     * @param poundage
     */
    void payUser(String appid,String merchantUserId,String merchantId ,BigDecimal fee,BigDecimal poundage);

    /**
     * 根据订单号查询未支付支付记录
     * @param orderNo
     * @return
     */
    PaymentRecord getByOrderNo(String orderNo);

    /**
     * 支付成功回调
     * @param paymentRecord
     */
    void notifySuccess(PaymentRecord paymentRecord);

    /**
     *  根据订单退款
     * @param orderNo
     * @param refundReason
     */
    void refundByOrder(String orderNo, String refundReason);
    
    
    /**
     *  根据订单退款
     * @param orderNo
     * @param refundReason
     */
    void refundByOrderNo(String orderNo, BigDecimal refundAmount,String refundReason);
}